#ifndef NETCONSOLE_H
#define NETCONSOLE_H

#include "ClientConsole.h"
#include <vector>
#include <string>

class ClientConsole;
struct _TCPsocket;
typedef struct _TCPsocket* TCPsocket;

class NetInternals;

class NetConsole
{
protected:
	Core *_core;
	int _port;

	NetInternals* _internals;
	
	bool _isRunning;
	std::vector<ClientConsole*> _clients;

	static int listenMain(void *owner);
	void addClient(TCPsocket clientSock, std::string clientName);
	void removeClient(ClientConsole *client);
public:
	NetConsole(Core *core, int port = 5678);
	~NetConsole();
	void whitelistAddress(std::string ipAddr);
	void deWhitelistAddress(std::string ipAddr);
	
	friend class ClientConsole;
};

#endif